package com.blacksheep.mtm.dao;

import com.blacksheep.mtm.dto.MemberDto;
import com.blacksheep.mtm.pojo.manager.TbMember;
import com.blacksheep.mtm.pojo.manager.TbMemberExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface TbMemberMapper {
    long countByExample(TbMemberExample example);

    int deleteByExample(TbMemberExample example);

    int deleteByPrimaryKey(Long id);

    int insert(TbMember record);

    int insertSelective(TbMember record);

    List<TbMember> selectByExample(TbMemberExample example);

    TbMember selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") TbMember record, @Param("example") TbMemberExample example);

    int updateByExample(@Param("record") TbMember record, @Param("example") TbMemberExample example);

    int updateByPrimaryKeySelective(TbMember record);

    int updateByPrimaryKey(TbMember record);

    List<MemberDto> selectListMemberInfo(@Param("search") String search, @Param("state") int[] state, @Param("minDate") String minDate,
                                         @Param("maxDate") String maxDate, @Param("orderCol") String orderCol,
                                         @Param("orderDir") String orderDir);


    List<MemberDto> selectListMemberByRole(@Param("role") int role,@Param("search") String search, @Param("state") int[] state, @Param("minDate") String minDate,
                                         @Param("maxDate") String maxDate, @Param("orderCol") String orderCol,
                                         @Param("orderDir") String orderDir);

    TbMember selectMemberByOpenid(String openid);

    TbMember selectDelivererByOpenid(String openid);

    TbMember selectMemberByPhoneAndRole(@Param("phone")String phone,@Param("role")Integer role);

    int deleteBatch(@Param("ids") Long[] ids);
}